Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@elastic/apm-rum-core
Advanced tools
@elastic/apm-rum-core is a JavaScript library for Real User Monitoring (RUM) that allows you to measure the performance of your web applications. It helps you capture and analyze user interactions, page load times, and other performance metrics to improve the user experience.
Initialize APM
This code initializes the APM agent with the specified service name, server URL, and environment. Initialization is the first step to start monitoring your application.
const { init } = require('@elastic/apm-rum-core');
const apm = init({
serviceName: 'my-service',
serverUrl: 'http://localhost:8200',
environment: 'production'
});
Capture Page Load Metrics
This function captures the page load metrics, including the time it takes for the page to load and other relevant performance data.
apm.capturePageLoad();
Capture Custom Transactions
This code demonstrates how to capture custom transactions. You can start a transaction, perform some operations, and then end the transaction to capture its performance metrics.
const transaction = apm.startTransaction('custom-transaction', 'custom');
// Perform some operations
transaction.end();
Capture Errors
This code captures errors that occur in your application. It helps you track and analyze errors to improve the stability and reliability of your application.
try {
// Some code that might throw an error
} catch (error) {
apm.captureError(error);
}
New Relic is a comprehensive monitoring tool that provides performance monitoring for web applications, servers, and infrastructure. It offers similar functionalities to @elastic/apm-rum-core, such as capturing page load metrics, custom transactions, and errors, but it also includes additional features like server monitoring and infrastructure monitoring.
Datadog RUM (Real User Monitoring) is a service that provides end-to-end visibility into the performance of your web applications. It captures user interactions, page load times, and errors, similar to @elastic/apm-rum-core. Datadog RUM integrates seamlessly with other Datadog services, providing a unified monitoring solution.
Sentry is an open-source error tracking tool that helps developers monitor and fix crashes in real-time. While it primarily focuses on error tracking, it also provides performance monitoring features similar to @elastic/apm-rum-core, such as capturing transactions and measuring page load times.
This is the core JavaScript module for Elastic APM.
Only use this package if you want to implement an integration for a framework that Elastic APM does not support yet.
You can find our documentation on our website.
If you are interested in contributing to Elastic APM JavaScript agent, please see our contributing guide.
We'd love to hear your feedback, please take a minute to fill out our survey.
This project is MIT licensed.
Made with ♥️ and ☕️ by Elastic and our community.
FAQs
Elastic apm core
We found that @elastic/apm-rum-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 67 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.